#define  _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>

using namespace std;

void test01()
{
	string s1 = "abcd";
	s1[0] = 'x';

	cout << s1 << endl;
}

void test02()
{
	string s1 = "abcd";

	string::iterator it = s1.begin();
	while (it!=s1.end())
	{
		cout << *it << ' ';
		it++;
	}

	cout << endl;
}

void test03()
{
	string s1 = "abcd";
	
	for (auto ch : s1)
	{
		cout << ch;
	}
	cout << endl;


	string::iterator it = s1.begin();
	while (it != s1.end())
	{
		(*it)++;
		cout << *it;
		it++;
	}
	cout << endl;



	for (int i = 0; i < s1.size(); i++)
	{
		cout << s1[i] ;
	}
	cout << endl;


}

void test04()
{
	string s1="abcd";

	string::reverse_iterator rit = s1.rbegin();
	while (rit!=s1.rend())
	{
		cout << *rit;
		rit++;
	}
	cout << endl;
}

void test05()
{
	const string s1="abcd";

	string::const_iterator it = s1.begin();
	while (it!=s1.end())
	{
		cout << *it;
		it++;
	}
	cout << endl;

	string::const_reverse_iterator rit = s1.rbegin();
	while (rit != s1.rend())
	{
		cout << *rit;
		rit++;
	}
	cout << endl;

	auto rit2 = s1.rbegin();
	while (rit2 != s1.rend())
	{
		cout << *rit2;
		rit2++;
	}
	cout << endl;
}

void test06()
{
	string s1="abcd";
	
	/*s1.insert(2, 1,'1');
	cout << s1 << endl;

	s1.insert(s1.begin(), '1');
	cout << s1 << endl;*/

	s1.insert(s1.end(), '1');
	cout << s1 << endl;
}


int main()
{
	//test01();
	//test02();
	//test03();
	//test04();
	//test05();
	test06();
	return 0;
}


















